package net.pluce.nxt.network;


import net.pluce.nxt.network.impl.BluetoothRobotConnection;
/**
 * Provide factory methods instantiating RobotConnection object using USB or Bluetooth protocol.
 * Will soon be able to give a list of available devices.
 * @author Pluce
 *
 */
public class RobotConnectionFactory {


	/*	
	public RobotConnectionFactory(){
		refreshDeviceList();
	}
	
	public void refreshDeviceList(){
		
	}
	*/
	/**
	 * Factory method creating a RobotConnection to the given NXT device over bluetooth
	 * @return a robot connection
	 */
	public static RobotConnection createBluetoothConnection(String nxtName, String nxtAddress,EventWatcher eventWatcher) throws RobotConnectionException{
		RobotConnection rc = new BluetoothRobotConnection(nxtName, nxtAddress);
		rc.setEventWatcher(eventWatcher);
		return rc;
	}
	

	/**
	 * Factory method creating a mock RobotConnection with the given file as a fake robot emitter
	 * @return a robot connection
	 */
	public static RobotConnection createMockConnection(String fakeRobotFileName,EventWatcher eventWatcher) throws RobotConnectionException{
		RobotConnection rc = new MockRobotConnection(fakeRobotFileName);
		rc.setEventWatcher(eventWatcher);
		return rc;
	}
}
